package com.lqs.dataservice.Controller;

import com.coxautodev.graphql.tools.GraphQLMutationResolver;
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.lqs.dataservice.Service.ArmyService;
import com.lqs.dataservice.entity.Army;
import com.nip.db.mongodb.utils.tips.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * ArmyController
 *
 * @author < a href=" ">BBB</ a>
 * @version v1.0.01
 * @date 2019-12-27 14:45
 */
@Component
public class ArmyController implements GraphQLQueryResolver, GraphQLMutationResolver {
  @Autowired
  ArmyService armyService;

  public List<Army> findAllArmy() {
    return armyService.findAllArmy();
  }

  public Army findArmyById(String id) {
    return armyService.findArmyById(id);
  }

  public Response saveArmy(Army entity) {
    return armyService.saveArmy(entity);
  }
  public Response deleteArmyById(String id) {
    return armyService.deleteArmyById(id);
  }



  }
